function r=retfs(y);

% Procedure that defines the return function, r(z,K,ks,xs,hu).

% some useful definitions

rate = thetak*exp(y(1))*y(2)^(thetak-1)*^thetas


/* defining the return function of a skilled worker */

proc retfs(y);
    local r;
    /* utility */
    r = (((((mu*y[8,1]^sigma+(1-mu)*(lambda*(y[2,1]+y[3,1])^rho
        +(1-lambda)*y[7,1]^rho)^(sigma/rho))^((1/sigma)-1)*(1-mu)
        *(lambda*(y[2,1]+y[3,1])^rho+(1-lambda)*y[7,1]^rho)^((sigma/rho)-1)
        *(1-lambda)*y[7,1]^(rho-1)*y[1,1])*y[10,1]
        +
        ((mu*y[8,1]^sigma+(1-mu)*(lambda*(y[2,1]+y[3,1])^rho
        +(1-lambda)*y[7,1]^rho)^(sigma/rho))^((1/sigma)-1)*(1-mu)
        *(lambda*(y[2,1]+y[3,1])^rho+(1-lambda)*y[7,1]^rho)^((sigma/rho)-1)
        *lambda*(y[2,1]+y[3,1])^(rho-1)*y[1,1])*y[4,1]
        -
        y[9,1])^(1-alfa)*(1-y[10,1])^alfa)^(1-theta))/(1-theta);
    retp(r);
endp;